<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProtocolPlanTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('protocol_plan', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('grid_id')->default(0)->comment('网格id');
            $table->integer('villager_ids')->default(0)->comment('村民id');
         
            $table->decimal('subsidy_fee', 10, 2)->default(0)->comment('搬迁补助费');
            $table->decimal('transition_fee', 10, 2)->default(0)->comment('临时过渡费');
            $table->decimal('require_sign_fee', 10, 2)->default(0)->comment('规定时间签约奖励费');
            $table->decimal('require_clear_fee', 10, 2)->default(0)->comment('规定时间腾房奖励费');
            $table->decimal('if_decorate_fee', 10, 2)->default(0)->comment('简装/不简装补助费');
            $table->decimal('other_subsidy_fee', 10, 2)->default(0)->comment('奖励临时过渡费');

            $table->decimal('stop_fee', 10, 2)->default(0)->comment('停产停业损失补偿金');
            $table->decimal('lack_area_fee', 10, 2)->default(0)->comment('不足45㎡结算差价');
            $table->decimal('money_fee', 10, 2)->default(0)->comment('货币补偿金');
            $table->decimal('yard_fee', 10, 2)->default(0)->comment('院落用地及附属物、构筑物补助费');
            $table->decimal('othe_build_fee', 10, 2)->default(0)->comment('院落用地土地使用权价值');
            $table->decimal('assess_fee', 10, 2)->default(0)->comment('评估补偿费');
            $table->decimal('use_fee', 10, 2)->default(0)->comment('土地使用权价值');
            $table->decimal('subsidiary_fee', 10, 2)->default(0)->comment('附着物补偿费');

            $table->decimal('house_difference_fee', 10, 2)->default(0)->comment('房屋上下靠结算差额');

            $table->decimal('party_a_fee', 10, 2)->default(0)->comment('总计费用');
            $table->timestamps();
            $table->softDeletes();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `protocol_plan` comment '协议分配表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('protocol_plan');
    }
}
